/**
 * Created by cfm on 16-12-4.
 */
var model = document.getElementById("myModel");

var btn = document.getElementById("myBtn");

var span = document.getElementsByClassName("close")[0];

btn.onclick = function () {
    model.style.display = "block";
}

span.onclick = function () {
    model.style.display = "none";
}

window.onclick = function (event) {
    if (event.target == model){
        model.style.display = "none";
    }
}